cmake_minimum_required(VERSION 3.5 FATAL_ERROR)

project(code03)

# 添加自定义cmake文件目录
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

# 使用Utility.cmake
include(Utility)

# 获取当前的分支
message(STATUS "Git branch         : ${GIT_BRANCH}")

# 获取当前的GIT_HASH
message(STATUS "Git commit hash    : ${GIT_COMMIT_HASH}")
message(STATUS "Git author name    : ${GIT_AUTHOR_NAME}")
message(STATUS "Git author email   : ${GIT_AUTHOR_EMAIL}")
message(STATUS "Git author date    : ${GIT_AUTHOR_DATE}")
message(STATUS "Git committer name : ${GIT_COMMITTER_NAME}")
message(STATUS "Git committer email: ${GIT_COMMITTER_EMAIL}")
message(STATUS "Git committer date : ${GIT_COMMITTER_DATE}")
message(STATUS "Git subject        : ${GIT_SUBJECT}")

configure_file(
  include/git_version.h.in
  include/git_version.h
  @ONLY
  )
  
include_directories(include)
add_executable(code03 main.cpp)
